﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using KaraokeManagementDTO;
using KaraokeManagementBUS;

namespace KaraokeManagement
{
    public partial class frmPhieuTinhTien : DevComponents.DotNetBar.Office2007Form
    {

        private int MaPhieuTiepNhanPhong = -1;
        private int MaKhachHang = -1;


        public frmPhieuTinhTien()
        {
            InitializeComponent();
        }

        /*
        public void loadFormData()
        {
            txtPhong.Text = ucQuanLyPhongHat.staticTenPhong;

            if (ucQuanLyPhongHat.staticMaPhieuDatPhong != -1)
            {
                groupPanel1.Enabled = false;
                groupPanel3.Enabled = false;
                //groupThongTinHangHoa.Enabled = true;
                //dgvDanhSachHangHoa.Enabled = true;


                //PhieuTiepNhanDatPhongDTO dto = new PhieuTiepNhanDatPhongDTO();
                dto = new PhieuTiepNhanDatPhongBUS().layThongTinPhieu(ucQuanLyPhongHat.staticMaPhieuDatPhong);

                MaPhieuTiepNhanPhong = dto.ID;

                //Load khách hàng
                loadKhachHang(dto.KhachHang_ID);

                //Load thông tin phòng
                txtGioVao.Text = dto.ThoiGianVao.Hour.ToString();
                txtPhutVao.Text = dto.ThoiGianVao.Minute.ToString();
                dateThoiGianVao.Value = dto.ThoiGianVao;

                //Load chi tiết phòng
                loadDanhSachCTPhieuDatPhong();
            }
        }

         
         */
        public void loadKhachHang(int MaKhachHang)
        {
            KhachHangDTO dto = new KhachHangDTO();
            dto = new KhachHangBUS().layThongTinKhachHang(MaKhachHang);

            //Load dữ liệu form
            txtHoTen.Text = dto.HoTen;
            txtDiaChi.Text = dto.DiaChi;
            txtSoCMND.Text = dto.SoCMND;
            txtSoDienThoai.Text = dto.SoDienThoai;
            cbGioiTinh.SelectedText = dto.GioiTinh;
            cbLoaiKH.SelectedValue = dto.LoaiKhachHang_ID;
        }



        public void initGioiTinh()
        {
            cbGioiTinh.Items.Add("Nam");
            cbGioiTinh.Items.Add("Nữ");
            cbGioiTinh.SelectedIndex = 0;
        }

        public void initLoaiKhachHang()
        {
            cbLoaiKH.DataSource = new LoaiKhachHangBUS().layDanhSachLoaiKhachHang();
            cbLoaiKH.DisplayMember = "TenLoaiKhachHang";
            cbLoaiKH.ValueMember = "ID";
        }

        public void initDanhSachHangHoa()
        {
            //cbTenHangHoa.DataSource = new HangHoaBUS().layDanhSachHangHoa();
            //cbTenHangHoa.DisplayMember = "TenHangHoa";
            //cbTenHangHoa.ValueMember = "ID";
        }

        public void initFormData()
        {
            txtGioVao.Text = DateTime.Now.Hour.ToString();
            txtPhutVao.Text = DateTime.Now.Minute.ToString();
            dateThoiGianVao.Value = DateTime.Now;
        }

        public void loadDanhSachCTPhieuDatPhong()
        {
            if (this.MaPhieuTiepNhanPhong != -1)
            {
                //dgvDanhSachHangHoa.DataSource = new ChiTietPhieuDatPhongBUS().layDanhSachChiTiet(this.MaPhieuTiepNhanPhong);
            }
        }


        public void initHangHoa()
        {
            //dgvcbTenHangHoa.DataSource = new HangHoaBUS().layDanhSachHangHoa();
            //dgvcbTenHangHoa.DisplayMember = "TenHangHoa";
            //dgvcbTenHangHoa.ValueMember = "ID";
        }
    }
}
